<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

?>
<div class="entry-edit">
    <div class="entry-edit-head">
        <h4 class="icon-head head-edit-form fieldset-legend"><?php echo Mage::helper('backend')->__('Product In Websites') ?></h4>
    </div>
    <fieldset id="grop_fields">
    <?php if($this->getProductId()): ?>
        <ul class="messages">
            <li class="notice-msg">
                <ul>
                    <li><?php// echo Mage::helper('backend')->__("Items that you don't want to show in the catalog or search results should have status 'Disabled' in the desired store.") ?></li>
                </ul>
            </li>
        </ul>
    <?php endif; ?>
        <div>
            <input type="text" name="storeID" value="Store ID">
        </div>

    <?php $cat = $this->getCategories()->load(2) ?>
    <div>
        <div>
            <p>Markup: $10.00 x 2.0 MU = $20.00</p>
            <p>Round Up: Moves the price up to the next increment, IE $19.25 becomes $19.50 using $0.50 round up</p>
            <p>Offset: $10.00 becomes $9.95 using $0.05 offset</p>


        </div>
        <div class="info">
            <label style="text-align:center;margin-left:260px;width:25px">Markup</label>
            <label style="text-align:center;margin-left:35px;width:25px">Round Up</label>
            <label style="text-align:center;margin-left:31px;width:25px">Offset</label>
        </div>
        <div class="catalog-name">
            <input name="HMU" value="all" class="checkbox catalog-checkbox" id="hmu" type="checkbox"/>
            <big><strong><label for="HMU"><?php echo "Use Heartwood's Markup" ?></label></strong></big>
            <input style="margin-left:68px;width:25px"  type="text" name="GMU" value="2.3" disabled>
            <input style="margin-left:50px;width:25px"  type="text" name="GRU" value="0.50" disabled>
            <input style="margin-left:50px;width:25px"  type="text" name="GOFF" value="0.00" disabled>
        </div>
        <div class="catalog-name">
            <input name="root" value="all" class="checkbox catalog-checkbox" id="root" type="checkbox" checked/>
            <big><strong><label for="root"><?php echo "All Products" ?></label></strong></big><input style="margin-left:164px;width:25px"  type="text" name="GMU" value="2.0">
            <input style="margin-left:50px;width:25px"  type="text" name="GRU" value="1.00">
            <input style="margin-left:50px;width:25px"  type="text" name="GOFF" value="0.01">
        </div>
        <div class="catalog-groups" id="root_data" style="width:250">
            <?php $array = $this->getCategories()->getCategories(2,1); $catCount[0] = 0; ?>
        <?php foreach($array as $cat_1): ?>
            <?php $catCount[0]++; $catCount[$catCount[0]]=0; ?>
            <h4 style ="text-indent:25px;"><div style="float:left;width:165px"><input name="sub_<?php echo $catCount[0]?>" value="<?php echo $cat_1->getId()?>" class="checkbox catalog-sub-checkbox" id="sub_<?php echo $cat_1->getId()?>" type="checkbox" checked />
            <?php echo $cat_1->getName() ?></div>
            <input style="margin-left:100px;width:25px"  type="text" name="sub_MU_<?php echo $catCount[0]?>" value="2.0">
            <input style="margin-left:49px;width:25px"  type="text" name="sub_RU_<?php echo $catCount[0]?>" value="1.00">
            <input style="margin-left:49px;width:25px"  type="text" name="sub_OFF_<?php echo $catCount[0]?>" value="0.01"></h4>

            <div class="sub-1-catalog">
            <table>
            <?php foreach ($this->getCategories()->getCategories($cat_1->getId(),1) as $cat_2): ?>
                <tr>
                    <?php $catCount[$catCount[0]]++; ?>
                    <td><h5 style ="text-indent:50px"><div style="float:left;width:163px"><input name="sub_<?php echo $catCount[0]?>_<?php echo $catCount[$catCount[0]]?>" value="<?php echo $cat_2->getId();?>" class="checkbox catalog-<?=$cat_1->getId?>-checkbox" id="sub_<?php echo $cat_1->getId()?>_<?php echo $cat_2->getId()?>" type="checkbox" checked/>
                    <?php echo $cat_2->getName() ?></div>
                        <input style="margin-left:100px;width:25px"  type="text" name="sub_<?php echo $catCount[0]?>_MU_<?php echo $catCount[$catCount[0]]?>" value="2.0">
                        <input style="margin-left:49px;width:25px"  type="text" name="sub_<?php echo $catCount[0]?>_RU_<?php echo $catCount[$catCount[0]]?>" value="1.00">
                        <input style="margin-left:49px;width:25px"  type="text" name="sub_<?php echo $catCount[0]?>_OFF_<?php echo $catCount[$catCount[0]]?>" value="0.01"></h5></td>
                    <td>
                    
                        <span class="website-<?php //echo $_website->getId() ?>-select" style="display:none">
                        <?php //echo Mage::helper('catalog')->__('(Copy data from: %s)', $this->getChooseFromStoreHtml($_store)) ?>
                        </span>
                    <?php //endif; ?>
                    </td>
                </tr>
            <?php endforeach; ?>
            </table>
            </div>
        <?php endforeach; ?>
        </div>
    </div>
    <?php //endforeach; ?>
        <input name="cat" type="hidden" value="<?php echo "$catCount[0]"; ?>">
        <?php $x = 0; $k=0; foreach($catCount as $var): ?>
            
            <?php if($x!==0): ?>
                <input name="cat_<?php echo $k; ?>" type="hidden" value="<?php echo $var ?>"
            <?php endif; $x=1; ?>
            <?php $k++; ?>
        <?php endforeach; ?>
    </fieldset>
</div>
<script type="text/javascript">

</script>